package com.qibo.cashier;

import android.content.Context;
import android.util.Log;

import com.hjq.toast.ToastUtils;
import com.qibo.baselib.api.BaseAppConfig;
import com.qibo.baselib.api.BaseMainControl;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.StringCallback;

import java.util.HashMap;
import java.util.Map;

public class MainControl {


    /*** 登录*/
    public static void get_login(String mobile,String password, StringCallback callBack){
        if(BaseMainControl.isNetwork()){
            ToastUtils.show("网络异常，请重试!");
            return;
        }
        HashMap<String,String> map = new HashMap<String, String>();
        map.putAll(BaseMainControl.getGinHandle(map));
        map.put("mobile",mobile);
        map.put("password",password);
        for (Map.Entry<String,String> entry:map.entrySet())
        {
            Log.e("tag",entry.getKey()+"=="+entry.getValue());
        }
        OkHttpUtils.post().url(BaseAppConfig.get_login).params(map).build().execute(callBack);
    }
    /***发送消息*/
    public static void get_sendSms(String mobile, StringCallback callBack){
        if(BaseMainControl.isNetwork()){
            ToastUtils.show("网络异常，请重试!");
            return;
        }
        HashMap<String,String> map = new HashMap<String, String>();
        map.putAll(BaseMainControl.getGinHandle(map));
        for (Map.Entry<String,String> entry:map.entrySet())
        {
            Log.e("tag",entry.getKey()+"=="+entry.getValue());
        }
        OkHttpUtils.post().url(BaseAppConfig.get_sendSms).params(map).build().execute(callBack);
    }
}
